3.138 \(\int (a+b \tanh ^2(c+d x)) \, dx\)

Optimal. Leaf size=19 \[ a x-\frac {b \tanh (c+d x)}{d}+b x \]

[Out]

a*x+b*x-b*tanh(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3473, 8} \[ a x-\frac {b \tanh (c+d x)}{d}+b x \]

Antiderivative was successfully verified.

[In]

Int[a + b*Tanh[c + d*x]^2,x]

[Out]

a*x + b*x - (b*Tanh[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rubi steps

\begin {align*} \int \left (a+b \tanh ^2(c+d x)\right ) \, dx &=a x+b \int \tanh ^2(c+d x) \, dx\\ &=a x-\frac {b \tanh (c+d x)}{d}+b \int 1 \, dx\\ &=a x+b x-\frac {b \tanh (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 28, normalized size = 1.47 \[ a x+\frac {b \tanh ^{-1}(\tanh (c+d x))}{d}-\frac {b \tanh (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Tanh[c + d*x]^2,x]

[Out]

a*x + (b*ArcTanh[Tanh[c + d*x]])/d - (b*Tanh[c + d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.40, size = 37, normalized size = 1.95 \[ \frac {{\left ({\left (a + b\right )} d x + b\right )} \cosh \left (d x + c\right ) - b \sinh \left (d x + c\right )}{d \cosh \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tanh(d*x+c)^2,x, algorithm="fricas")

[Out]

(((a + b)*d*x + b)*cosh(d*x + c) - b*sinh(d*x + c))/(d*cosh(d*x + c))

________________________________________________________________________________________

giac [A]  time = 0.13, size = 29, normalized size = 1.53 \[ a x + \frac {{\left (d x + c + \frac {2}{e^{\left (2 \, d x + 2 \, c\right )} + 1}\right )} b}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tanh(d*x+c)^2,x, algorithm="giac")

[Out]

a*x + (d*x + c + 2/(e^(2*d*x + 2*c) + 1))*b/d

________________________________________________________________________________________

maple [B]  time = 0.02, size = 47, normalized size = 2.47 \[ a x -\frac {b \tanh \left (d x +c \right )}{d}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right ) b}{2 d}+\frac {\ln \left (1+\tanh \left (d x +c \right )\right ) b}{2 d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*tanh(d*x+c)^2,x)

[Out]

a*x-b*tanh(d*x+c)/d-1/2/d*ln(tanh(d*x+c)-1)*b+1/2/d*ln(1+tanh(d*x+c))*b

________________________________________________________________________________________

maxima [A]  time = 0.30, size = 31, normalized size = 1.63 \[ b {\left (x + \frac {c}{d} - \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} + a x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tanh(d*x+c)^2,x, algorithm="maxima")

[Out]

b*(x + c/d - 2/(d*(e^(-2*d*x - 2*c) + 1))) + a*x

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 18, normalized size = 0.95 \[ x\,\left (a+b\right )-\frac {b\,\mathrm {tanh}\left (c+d\,x\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a + b*tanh(c + d*x)^2,x)

[Out]

x*(a + b) - (b*tanh(c + d*x))/d

________________________________________________________________________________________

sympy [A]  time = 0.16, size = 20, normalized size = 1.05 \[ a x + b \left (\begin {cases} x - \frac {\tanh {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \tanh ^{2}{\relax (c )} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tanh(d*x+c)**2,x)

[Out]

a*x + b*Piecewise((x - tanh(c + d*x)/d, Ne(d, 0)), (x*tanh(c)**2, True))

________________________________________________________________________________________